import { CodeToText } from 'element-china-area-data'
export function getCityStr(code, space = ',') {
  // code 城市的code，
  // splicing 拼接符
  // space 字符串的分割符
  if (!code) return []
  let codeList = []
  if (typeof code === 'string') {
    codeList = code.split(space)
  } else if (Array.isArray(code)) {
    codeList = code
  }
  return codeList.map(item => {
    return CodeToText[item]
  })
}
export const accountConfig = [
  {
    prop: 'account',
    label: '手机号/账号'
  },
  {
    prop: 'password',
    label: '密码',
    type: 'password'
  }
]
export const infoConfig = [
  {
    prop: 'nickname',
    label: '昵称'
  },
  {
    prop: 'sex',
    label: '性别',
    type: 'radio',
    options: [
      {
        label: '男',
        value: 1
      },
      {
        label: '女',
        value: 0
      }
    ]
  },
  {
    prop: 'city',
    label: '地区',
    type: 'city'
  },
  {
    prop: 'birthDay',
    label: '生日',
    type: 'date'
  },
  {
    prop: 'signature',
    label: '个性签名',
    type: 'textarea'
  }
]

// 详情歌曲
export const detailConfig = [
  {
    prop: 'songName',
    label: '歌名',
    width: '150'
  },
  {
    prop: 'description',
    label: '简介'
  },
  {
    prop: 'songerName',
    label: '歌手'
  },
  {
    prop: 'title',
    label: '歌单'
  }
]
